QuickTime 4 API Documentation

3D Graphics Programming with QuickDraw 3D 1.5.4

Previous | QD3D Book | Overview | Chapter Contents | Next |

Managing Textures

QuickDraw 3D provides routines that you can use to get information about the characteristics of a texture. You can get the dimensions of a texture, as well as the number of channels and the number of bits per channel. You cannot, however, reset any of these texture characteristics (they are determined at the time you create a texture object). You can also get the current alpha and RGB channels of a texture. You can reset these characteristics to achieve special effects.

To create a texture object, you need to create an instance of some subclass of the texture class. For example, you can create a pixmap texture object by calling Q3PixmapTexture_New . See "Managing Pixmap Textures" for information on creating and manipulating pixmap textures.

Q3Texture_GetType

You can use the Q3Texture_GetType function to get the type of a texture object.

TQ3ObjectType Q3Texture_GetType (TQ3TextureObject texture);
texture
A texture object.

DESCRIPTION

The Q3Texture_GetType function returns, as its function result, the type of the texture object specified by the texture parameter. The type of texture objects currently supported by QuickDraw 3D is defined by these constants:

kQ3TextureTypePixmap
kQ3TextureTypeMipmap

If the specified texture object is invalid or is not of this type, Q3Texture_GetType returns the value kQ3ObjectTypeInvalid .

Q3Texture_GetWidth

You can use the Q3Texture_GetWidth function to get the width of a texture.

TQ3Status Q3Texture_GetWidth (
                     TQ3TextureObject texture,
                     unsigned long *width);
texture
A texture object.
width
On exit, the width of the specified texture.

DESCRIPTION

The Q3Texture_GetWidth function returns, in the width parameter, the width of the texture specified by the texture parameter.

Q3Texture_GetHeight

You can use the Q3Texture_GetHeight function to get the height of a texture.

TQ3Status Q3Texture_GetHeight (
                     TQ3TextureObject texture,
                     unsigned long *height);
texture
A texture object.
height
On exit, the height of the specified texture.

DESCRIPTION

The Q3Texture_GetHeight function returns, in the height parameter, the height of the texture specified by the texture parameter.


© 1997 Apple Computer, Inc.

Previous | QD3D Book | Overview | Chapter Contents | Next |